/*************************************************************************
  > File Name   : testnet.cpp
  > Author      : zhongsx
  > Mail        : zhong17hao@gmail.com or  kuai2361425@163.com
  > Created Time: 2016年07月05日 星期二 11时00分28秒
 ************************************************************************/

#include <iostream>
#include <memory>
#include <boost/asio.hpp>
#include <boost/shared_ptr.hpp>

#include "../net/async_server.hpp"
#include "../net/session.hpp"

using namespace std;



void callback_read_msg(boost::shared_ptr<session>& psess, boost::shared_ptr<message>& msg)
{
    std::cout << "recive one msg" << std::endl;
}

int main()
{
    boost::asio::io_service ios;
    async_server server(ios, 8090);

    server.set_cb_read_msg(
        [](boost::shared_ptr<session>& session, boost::shared_ptr<message>& msg){
            callback_read_msg(session, msg);
        }
    );

    server.run();
    return 0;
}
